package com.inspur.jxpcxt.service;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;

import com.inspur.jxpcxt.constants.ServerConstants;
import com.inspur.jxpcxt.utils.CommonService;
/**
 * 教师登录的service
 * @author Administrator
 *
 */
public class TeaLoginService {
	
	@SuppressWarnings("deprecation")
	public static String TeaLoginByClientGet(String tno){
			//创建HttpClien对象
			HttpClient client = new DefaultHttpClient();
			//拼装路径
			String path = null;
			try {
				path = "http://"+ServerConstants.SERVER_IP+":8080/Web/LoginServlet?tno="
						+URLEncoder.encode(tno)
						+"&service="
						+URLEncoder.encode(ServerConstants.SERVER_TEA_LOGIN_SEVICE, "UTF-8");
			} catch (UnsupportedEncodingException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		return CommonService.serviceRequest(path, client);
			
	}
}
